package com.tjsinfo.tjsoa.documentationflow.dangweishouwen.bo;

import java.util.List;

import com.tjsinfo.tjsoa.documentationflow.dangweifawen.dao.ITDangweifawenFujianDAO;
import com.tjsinfo.tjsoa.documentationflow.dangweifawen.vo.TDangweifawenFujian;
import com.tjsinfo.tjsoa.documentationflow.dangweishouwen.dao.ITDangweishouwenFujianDAO;
import com.tjsinfo.tjsoa.documentationflow.dangweishouwen.vo.TDangweishouwenFujian;
//import com.tjsinfo.tjsoa.documentationflow.gonghuifawei.dao.ITGonghuifaweiFujianDAO;
//import com.tjsinfo.tjsoa.documentationflow.gonghuifawei.vo.TGonghuifaweiFujian;
import com.tjsinfo.tjsoa.documentationflow.xingzhengshouwen.vo.TXingzhengshouwenFujian;

public class TDangweishouwenFujianBO implements ITDangweishouwenFujianBO {
	private ITDangweishouwenFujianDAO dangweishouwenFujianDAO;
	

	public ITDangweishouwenFujianDAO getDangweishouwenFujianDAO() {
		return dangweishouwenFujianDAO;
	}


	public void setDangweishouwenFujianDAO(
			ITDangweishouwenFujianDAO dangweishouwenFujianDAO) {
		this.dangweishouwenFujianDAO = dangweishouwenFujianDAO;
	}




	public TDangweishouwenFujian selectById(String id){
		return  dangweishouwenFujianDAO.findById(id);
	}
	
	public Boolean deleteFujian(TDangweishouwenFujian xingzhengshouwenFujian) {
		// TODO Auto-generated method stub
		try {
			dangweishouwenFujianDAO.delete(xingzhengshouwenFujian);
			return true;
		} catch (RuntimeException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return false;
	}






	public Boolean addFujian(TDangweishouwenFujian xingzhengshouwenFujian) {
		// TODO Auto-generated method stub
		try {
			dangweishouwenFujianDAO.save(xingzhengshouwenFujian);
			return true;
		} catch (RuntimeException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return false;
	}
	
	public List<TDangweishouwenFujian> selectByDocId(String docid){
		return  dangweishouwenFujianDAO.findByProperty("TDangweishouwenNeirong.id", docid);
	}
	
	public String addFujianId(TDangweishouwenFujian dangweishouwenFujian){
		try {
			return  dangweishouwenFujianDAO.save(dangweishouwenFujian);
			
		} catch (RuntimeException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return "1";
	}
	
	public Boolean updateFujian(TDangweishouwenFujian xingzhengshouwenFujian){
		try {
			dangweishouwenFujianDAO.update(xingzhengshouwenFujian);
			return true;
		} catch (RuntimeException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			return false;
		}
	}
}
